//
//  Common.swift
//  手账
//
//  Created by zhuxiaoxiang on 2018/11/15.
//  Copyright © 2018年 zhuxiaoxiang. All rights reserved.
//

import UIKit

#if DEBUG
let isProduction = false
#else
let isProduntion = true
#endif

// iPhone
let IS_iPhone = (UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.phone ? true : false)
// iPad
let IS_iPad = (UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad ? true : false)
// iPhone4
let IS_iPhone4 = (max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) < 568.0 ? true : false)
// iPhone5
let IS_iPhone5 = (max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) == 568.0 ? true : false)
// iPhone6
let IS_iPhone6 = (max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) == 667.0 ? true : false)
// iPhone6P
let IS_iPhone6P = (max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) == 736.0 ? true : false)
// iPhoneX
let IS_iPhoneX = (max(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) == 812.0 ? true : false)
// iPhoneX底部预留高度
let HomeBarH = (IS_iPhoneX ? 34 : 0)
// 定义一些常量
let kScreenW = UIScreen.main.bounds.size.width
let kScreenH = UIScreen.main.bounds.size.height
let kStatusBarH = UIApplication.shared.statusBarFrame.size.height
let kNavBarH = (IS_iPhoneX ? 44 : 40)
let kTabBarH = (IS_iPhoneX ? 83 : 49)
// 通知中心
let kNotificationCenter = NotificationCenter.default
// 用户偏好设置
let kUserDefaults = UserDefaults.standard

// 主色调
let kBaseGrayColor = UIColor.hex(hexString: "EEEEEE")
let kBaseBlueColor = UIColor.hex(hexString: "6D86FF")

// MARK: - 通用提示
let ErrorMsg = "网络异常"

func Mprint<T>(_ message: T, _ file: String = #file, _ methodName: String = #function, _ lineNumber: Int = #line) {
    #if DEBUG
        print("file:\(file)-method:\(methodName)-line:\(lineNumber)-\(message)")
    #endif
}
